/*
* 第一份idea测试作业：输出金字塔
* author：郑国荣
*     *
     ***
    *****
   *******
  *********
 * */

//public class PyramidPattern {
//    public static void main(String[] args) {
//        for (int i =0;i<4;i++){
//            for (int k=8;k>=i;k--)
//                System.out.print(" ");
//            for (int j=0;j<=2*i;j++){
//                System.out.print("$");
//            }
//            System.out.println();
//        }
//
//    }
//}

import java.util.Scanner;
public  class PyramidPattern {


    public static void main(String[] args) {
        System.out.println("请输入金字塔行列数：");
        Scanner src=new Scanner(System.in);

        int row=src.nextInt();

        String [][]array=new String[row][row*2];
        int i=0,j=0;

        while (i!=row){
            if((i+j>=row-1&&j<row)||(j-i<=row-1&&j>row-1))
            array[i][j]="* ";
            else   array[i][j]="  ";
            if(j==row*2-1){
                System.out.println(array[i][j]);
                j=0;i++;
            }
            else {
                System.out.print(array[i][j]);
                j++;
            }
        }
    }
}

